package staffs

import (
	"github.com/flipped-aurora/gin-vue-admin/server/api/v1"
	"github.com/flipped-aurora/gin-vue-admin/server/middleware"
	"github.com/gin-gonic/gin"
)

type StaffRouter struct {
}

// InitStaffRouter 初始化 staff表 路由信息
func (s *StaffRouter) InitStaffRouter(Router *gin.RouterGroup) {
	staffRouter := Router.Group("staff").Use(middleware.OperationRecord())
	staffRouterWithoutRecord := Router.Group("staff")
	var staffApi = v1.ApiGroupApp.StaffsApiGroup.StaffApi
	{
		staffRouter.POST("createStaff", staffApi.CreateStaff)   // 新建staff表
		staffRouter.DELETE("deleteStaff", staffApi.DeleteStaff) // 删除staff表
		staffRouter.DELETE("deleteStaffByIds", staffApi.DeleteStaffByIds) // 批量删除staff表
		staffRouter.PUT("updateStaff", staffApi.UpdateStaff)    // 更新staff表
	}
	{
		staffRouterWithoutRecord.GET("findStaff", staffApi.FindStaff)        // 根据ID获取staff表
		staffRouterWithoutRecord.GET("getStaffList", staffApi.GetStaffList)  // 获取staff表列表
	}
}
